#!/usr/bin/python
# -*- coding: UTF-8 -*-

#关闭苹果app

from mysql import MysqlManager

db = MysqlManager()

def main():
	#获取当前配置
	try:
		f=open('doorKey')
		versionStr=f.read()
		f.close()

		#关强更
		db.update("update config set config_value=0 where id=54 and config_key='update_app_store' ")

		#关闭开关
		db.update("update config set config_value='%s' where id=49 and config_key='apple_version' "%versionStr)

		#切换线上包
		db.update("update download_url set status=0 where id=6")	#线上包
		db.update("update download_url set status=1 where id=3")	#企业包
	except:
		print 'Error:no file found!'
		
		# print sql
	
main()
db.close()
